package com.dries.portal.module.chat.utils;

import lombok.extern.slf4j.Slf4j;

import java.util.HashSet;
import java.util.Set;

/**
 * @Description: 用户ID 和 Channel 关联
 * @Author ZSY
 * @createTime 2020/8/11 13:37
 */
@Slf4j
public class UserChannelRel {

    private static final Set<String> manager = new HashSet<>();

    public static void put(String online, String username) {
        // TODO 验证用户是否登录 （redis）
        manager.add(username);
    }

    public static Set<String> get() {
        return manager;
    }

    public static void remove(String username) {
        manager.remove(username);
    }

    public static Integer size() {
        return manager.size();
    }

}
